<?php

/**
 *  Lazap exception.
 *
 *  This is base class of all exceptions used in Lazap lib.
 */
class LzException
        extends RuntimeException
{
    public
    function __construct($msg = '', $code = 0)
    {
        parent::__construct(
                LzStr::like($msg) ? (string)$msg : print_r($msg, true),
                $code
            );
    }
}


/**
 *  Exception used to indicate that invalid value was passed.
 *
 *  Its message containts the value that was passed.
 */
class LzBadValue
        extends LzException
{}


/**
 *  Exception used to indicate that something is used wrong.
 *
 *  Its message containts what was used wrong.
 */
class LzBadUsage
        extends LzException
{}

